//
//  NENetWorkManager.m
//  NetEasyNews
//
//  Created by weiwang on 16/7/17.
//  Copyright © 2016年 王伟. All rights reserved.
//

#import "NENetWorkManager.h"

@implementation NENetWorkManager
+(instancetype)sharedInstance
{
    static NENetWorkManager *instance;
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^(){
      
        NSURL *url = [NSURL URLWithString:@"http://c.m.163.com/"];
        NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
        instance = [[self alloc]initWithBaseURL:url sessionConfiguration:config];
        
        instance.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", nil];
    });
                  
    return instance;
}


+(instancetype)shareNoBaseURLInstance
{
    static NENetWorkManager *instance;
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^(){
        
        NSURL *url = [NSURL URLWithString:@""];
        NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
        instance = [[self alloc]initWithBaseURL:url sessionConfiguration:config];
        
        instance.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", nil];
    });
    
    return instance;
}
@end
